// 探索发现数据
var wallpaperList = [{
	img: "../img/cate/find_photo_banner.png",
	// 数量
	count: 46
}]
// 热门创作者数据
var creatorList = [{
		// 背景图片
		bg: "../img/cate/popular%20author_img.png",
		// 头像
		img: "../img/cate/popular%20author_photo_head%20portrait.png",
		// 名称
		name: "摄影师洲桦",
		// 标签
		label: "资深风光摄影师",
		// 是否关注
		focus: false
	},
	{
		bg: "../img/cate/popular%20author_img.png",
		img: "../img/cate/popular%20author_photo_head%20portrait.png",
		name: "摄影师洲桦",
		label: "资深风光摄影师",
		focus: false
	},
	{
		bg: "../img/cate/popular%20author_img.png",
		img: "../img/cate/popular%20author_photo_head%20portrait.png",
		name: "摄影师洲桦",
		label: "资深风光摄影师",
		focus: true
	},
]
// 每周精选数据
var topPickList = [{
		img: "../img/cate/weekly%20top%20picks_img%20small.png",
		title: "创意摄影",
		text: "脑洞大开的创意图片"
	},
	{
		img: "../img/cate/weekly%20top%20picks_img%20small.png",
		title: "创意摄影",
		text: "脑洞大开的创意图片"
	}
]
//打卡胜地数据
var clockList = [{
		img: "../img/cate/weekly%20top%20picks_img%20small.png",
		text: "超级喜欢一望无际的海洋",
		// 头像
		headImg: "../img/cate/popular%20author_photo_head%20portrait.png",
		name: "追风少年",
		// 地点
		position: "深圳",
		// 图片数量
		count: 6
	},
	{
		img: "../img/cate/weekly%20top%20picks_img%20small.png",
		text: "超级喜欢一望无际的海洋",
		headImg: "../img/cate/popular%20author_photo_head%20portrait.png",
		name: "追风少年",
		position: "深圳",
		count: 6
	}
]
//探索发现
function getWallPaper() {
	for (var i = 0; i < wallpaperList.length; i++) {
		$("#wallPaper").append('<img src=' + wallpaperList[i].img +
			' class="img" /><div class="infoBox"><div>壁纸</div><div class="bg"></div><div>' + wallpaperList[i].count +
			'</div></div>')
	}
}
//热门创作者
function getCreator() {
	for (var i = 0; i < creatorList.length; i++) {
		$(".creatorUl").append('<li><img src=' + creatorList[i].bg + ' class="bg" />' +
			'<img src=' + creatorList[i].img + ' class="img" /><p class="name">' + creatorList[i].name + '</p>' +
			'<p class="label">' + creatorList[i].label + '</p><input type="button" value="" class="btn" /></li>')
			if(creatorList[i].focus){
				$(".creatorUl li:eq("+i+") .btn").val("已关注")
			}else{
				$(".creatorUl li:eq("+i+") .btn").val("关注")
			}
	}
	$(".btn").each(function(index){
		$(this).on("click",function(){
			creatorList[index].focus=!creatorList[index].focus
			$(".creatorUl").empty()
			getCreator()
		})
	})

}
//每周精选
function getTopPick() {
	for (var i = 0; i < topPickList.length; i++) {
		$(".pickUl").append('<li><img src=' + topPickList[i].img + ' class="img" /><p class="title">' + topPickList[i].title +
			'</p><p class="text">' + topPickList[i].text + '</p></li>')
	}
}
//打卡胜地
function getClock() {
	for (var i = 0; i < clockList.length; i++) {
		$(".clockUl").append('<li><div class="imgBox"><img src=' + clockList[i].img +
			' class="img" /><div class="iconBox"><div class="icon"></div><div class="count">' +
			clockList[i].count + '</div></div></div><div class="text">' + clockList[i].text +
			'</div><div class="infoBox"><div class="info"><img src=' + clockList[i].headImg +
			' class="headImg" /><div class="name">' + clockList[i].name + '</div></div><div class="position">' + clockList[i].position +
			'</div></div></li>')
	}
}

var all = {
	getWallPaper: getWallPaper,
	getCreator: getCreator,
	getTopPick: getTopPick,
	getClock: getClock
}
// 初始化
all.getWallPaper()
all.getCreator()
all.getTopPick()
all.getClock()
